package com.flow.dao.impl;

import java.util.ArrayList;
import java.util.List;

import com.flow.dao.IBankChargeDao;
import com.flow.model.BankCharge;
import com.flow.model.PagerModel;

/**
 * 
 * 银行充值记录Dao
 * 
 * @author wang
 * @2016-2-16 BankChargeDao.java
 * @param <T>
 */
public class BankChargeDao<T> extends BaseDao<T> implements IBankChargeDao<T> {

	@Override
	public boolean insertBankCharge(BankCharge bankCharge) {

		try {

			this.insert(bankCharge);
			return true;

		} catch (Exception e) {

			e.printStackTrace();

		}

		return false;
	}

	@Override
	public boolean updateBankCharge(BankCharge bankCharge) {

		try {

			this.update(bankCharge);
			return true;

		} catch (Exception e) {

			e.printStackTrace();

		}

		return false;
	}

	@Override
	public boolean deleteBankCharge(BankCharge bankCharge) {

		try {

			this.delete(bankCharge);
			return true;

		} catch (Exception e) {

			e.printStackTrace();

		}

		return false;
	}

	@Override
	public BankCharge findBankChargeByHql(String hql) {

		return this.findBankChargeByHql(hql, null);
		
	}

	@Override
	public BankCharge findBankChargeByHql(String hql, Object param) {
		
		List<Object> params = new ArrayList<Object>();
		params.add(param);
		return this.findBankChargeByHql(hql, params);
	}

	@Override
	public BankCharge findBankChargeByHql(String hql, List<Object> params) {

		return (BankCharge)this.findByHql(hql, params);

	}

	@Override
	public int universalMethodBankCharge(String hql) {
		
		return universalMethodBankCharge(hql, null);
	}

	@Override
	public int universalMethodBankCharge(String hql, Object param) {
		
		List<Object> params = new ArrayList<Object>();
		params.add(param);
		return universalMethodBankCharge(hql, params);
		
	}

	@Override
	public int universalMethodBankCharge(String hql, List<Object> params) {

		return this.universalMethod(hql, params);
		
	}

	@Override
	public List<T> findBankChargeAllByHql(String hql) {

		return findBankChargeAllByHql(hql, null);
	
	}

	@Override
	public List<T> findBankChargeAllByHql(String hql, Object param) {

		List<Object> params = new ArrayList<Object>();
		params.add(param);
		return findBankChargeAllByHql(hql, params);
		
	}

	@Override
	public List<T> findBankChargeAllByHql(String hql, List<Object> params) {
		
		return this.findAllByHql(hql, params);

	}

	@Override
	public PagerModel findBankChargePagerModeled(PagerModel pager, String hql) {
		
		return this.findBankChargePagerModeled(pager, hql);
	
	}

	@Override
	public PagerModel findBankChargePagerModeled(PagerModel pager, String hql,
			Object param) {

		List<Object> params = new ArrayList<Object>();
		params.add(param);
		return this.findBankChargePagerModeled(pager, hql, params);
		
	}

	@Override
	public PagerModel findBankChargePagerModeled(PagerModel pager, String hql,
			List<Object> params) {
		
		return this.findBankChargePagerModeled(pager, hql, params);
		
	}

}
